<!-- BeginDsi "dsi/head.html" -->
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Embedthis GoAhead 3.2.1 Documentation</title>
    <meta name="keywords" content="embedded web server, web server software, embedded HTTP, application web server, 
        embedded server, small web server, HTTP server, library web server, library HTTP, HTTP library" />
    <meta name="description" content="Embedthis Sofware provides commercial and open source embedded web servers for 
        devices and applications." />
	<meta name="robots" content="index,follow" />
	<link href="../../doc.css" rel="stylesheet" type="text/css" />
	<link href="../../print.css" rel="stylesheet" type="text/css" media="print"/>
    <!--[if IE]>
    <link href="../../iehacks.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <link href="http://www.google.com/cse/style/look/default.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-179169-5']);
        _gaq.push(['_trackPageview']);
        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
</head>

<body>
    <div class="top">
        <a class="logo" href="http://embedthis.com/products/goahead/">&nbsp;</a>
        <div class="topRight">
            <div class="search">
                <div id="cse-search-form"></div>
                <div class="version">Embedthis GoAhead 3.2.1</div>
            </div>
        </div>
        <div class="crumbs">
            <a href="../../index.html">Home</a>
<!-- EndDsi -->
             &gt;<a href="index.html">Installation</a> &gt; <b>Installing Supporting Packages</b>
        </div>
    </div>
    <div class="content">
        <div class="contentRight">
            <h1>Quick Nav</h1>
            <ul>
                <li><a href="#matrixssl">MatrixSSL</a></li>
                <li><a href="#openssl">OpenSSL</a></li>
                <li><a href="#uclibc">uClibc</a></li>
            </ul>
<!-- BeginDsi "dsi/installSeeAlso.html" -->
            <h1>See Also</h1>
            <ul class="nav">
                <li><a href="../../product/install/index.html">Installing</a></li>
                <li><a href="../../guide/goahead/overview.html">GoAhead Overview</a></li>
                <li><a href="../../guide/goahead/features.html">GoAhead Features</a></li>
                <li><a href="../../product/releaseNotes.html">Release Notes</a></li>
                <li><a href="../../product/changeLog.html">Change Log</a></li>
                <li><a href="../../product/roadmap.html">Roadmap</a></li>
                <li><a href="../../product/compatibility.html">Compatibility</a></li>
                <li><a href="../../licenses/index.html">Licensing</a></li>

                <li><a href="../../guide/goahead/users/gettingStarted.html">Getting Started</a></li>
                <li><a href="../../guide/goahead/users/index.html">Users Guide</a></li>

                <li><a href="../../guide/goahead/source/building.html">Building from Source</a></li>
                <li><a href="../../guide/goahead/source/porting.html">Porting Guide</a></li>
            </ul>
<!-- EndDsi -->
        </div>
        <div class="contentLeft">
            <h1>Installing Supporting Packages</h1>
            <p>GoAhead leverages other packages such as OpenSSL for additional functionality. GoAhead may be built for
            specific environments such as the small C library, uClibc.</p>
            <p>Sometimes, you may have a requirement to rebuild one of these packages to add or remove features. This
            document describes the build process that Embedthis uses to build these packages. <b>NOTE:</b> we cannot
            support the building of these 3rd party packages. That is your responsibility and the responsibility of the
            various groups and vendors who provide these packages.</p>
            <p>See the package specific notes for:</p>
            <ul>
                <li><a href="#matrixssl">MatrixSSL</a></li>
                <li><a href="#openssl">OpenSSL</a></li>
                <li><a href="#uclibc">uClibc</a></li>
            </ul>
            <h2 class="section">Patched Packages</h2>
            <p>Often minor changes are required to get a package to build cleanly with GoAhead on some platforms.
            Embedthis archives the patched packages used with GoAhead in a Git repository at <a href=
            "http://github.com/embedthis/packages">http://github.com/embedthis/packages</a>.</p>
            <p>Use the following to checkout a copy of the packages:</p>
            <pre>
git clone http://github.com/embedthis/packages
</pre>
            <p>There is a top level Makefile which will build all the packages and there are individual Makefiles for
            each package. <b>NOTE:</b> Embedthis provides these packages as a service. The Makefiles and packages
            themselves are not supported.</p><a id="matrixssl"></a>
            <h2 class="section">MatrixSSL</h2>
            <p><a href="http://www.peersec.com">PeerSec</a> provide the <a href=
            "http://www.matrixssl.org">MatrixSSL TLS/SSL</a> product which can be downloaded from <a href=
            "http://www.matrixssl.org">www.matrixssl.org</a>. Consult their instructions and build using the standard
            steps.</p>
            <p>Configure GoAhead using the --with matrixssl switch</p>
            <pre>
./configure --with matrixssl    
</pre>
            <p>You may need to edit the build/packages/matrixssl configuration file to further modify the compiler and
            linker flags and search paths to match your configuration. You may need to define the base directory which
            can optionally be provided as a switch to the --with matrixssl switch.</p><a id="openssl"></a>
            <h2 class="section">OpenSSL</h2>
            <p>These instructions are suitable for building OpenSSL version 0.9.7d.</p>
            <ul>
                <li><a href="#openssllinux">OpenSSL 0.9.7d on Linux</a></li>
                <li><a href="#opensslwindows">OpenSSL 0.9.7d on Windows</a></li>
            </ul><a id="openssllinux"></a>
            <h3>Building OpenSSL 0.9.7d on Linux for X886</h3>
            <p>Use the following commands to build OpenSSL natively on Linux:</p>
            <pre>
./config
make
</pre>
            <p>To build single threaded, use the "--no-threads" option. If you wish to also build OpenSSL as shared
            libraries, use:</p>
            <pre>
make build-shared
</pre>
            <p>After you have built OpenSSL you must reference the OpenSSL installation directory in your GoAhead
            configuration. You can set this via the <b>configure</b> command. You may need to define the base directory
            which can optionally be provided as a switch to the --with openssl switch.</p>
            <pre>
./configure --with openssl=../../openssl-0.9.7d
</pre>
            <p>You may need to edit the build/packages/openssl configuration file to further modify the compiler and
            linker flags and search paths to match your configuration.</p><a id="opensslwindows"></a>
            <h3>Building OpenSSL 0.9.7d on Windows for X886</h3>
            <p>The Windows OpenSSL build system uses Perl and nmake. The following commands will build the required
            shared libraries (DLLs) for GoAhead to use OpenSSL.</p>
            <pre>
perl Configure VC-WIN32
cmd /c ms\\do_masm
rm -f libcrypto.lib libeay32.dll libssl.lib ssleay32.dll
rm -f out32dll/*.exe out32dll/*.dll out32dll/*.lib
rm -f tmp32dll/*
perl Configure VC-WIN32
cmd /c ms\\do_masm.bat
nmake -f ms/ntdll.mak
mv out32dll/libeay32.lib libcrypto.lib
mv out32dll/ssleay32.lib libssl.lib
mv out32dll/*.dll .
cp -r inc32/openssl include
</pre>
            <p>After you have built OpenSSL you must reference the OpenSSL installation directory in your GoAhead
            configuration. You can set this via the <b>configure</b> command. You may need to define the base directory
            which can optionally be provided as a switch to the --with openssl switch.</p>
            <pre>
./configure --with openssl=../../openssl-0.9.7d
</pre>
            <p>You may need to edit the build/packages/openssl configuration file to further modify the compiler and
            linker flags and search paths to match your configuration.</p><a id="uclibc"></a>
            <h2 class="section">uClibc</h2>
            <p>To get the smallest executable possible, there are several alternatives to the standard libc library.
            One of the leading tiny libcs on Linux is uClibc. For general information go to: <a href=
            "http://www.uclibc.org">www.uclibc.org</a>.</p>
            <p>To link with uClibc, you must first create a compiler tool chain that will link GoAhead with the uClibc
            library. This is not always an easy process. The easiest way appears to be to get one of the pre-built root
            file systems that contain the complete cross compiler and uClibc library. You then mount this file system,
            make it your root file system and copy the GoAhead source into it and build it there.</p>
            <p>When you run the <b>configure</b> command, you will need to supply the Cross compiler settings. These
            are passed to <b>configure</b> via environment variables. For example, the following script configures
            GoAhead to build using the arm-linux cross compiler (supporting uclibc) that is installed under
            /usr/local.</p>
            <pre>
DIR=/usr/local ; \<br />export CC=arm-linux-uclibc-gcc ; \<br />GCC_DIR=`$$CC -print-libgcc-file-name 2&gt;&amp;1 | sed -e 's/\/libgcc.a//'` ; \<br />AR=arm-linux-uclibc-ar \<br />LD=arm-linux-uclibc-ld \<br />RANLIB=arm-linux-uclibc-ranlib \<br />IFLAGS="-I$$DIR/arm-linux-uclibc/include -I$$GCC_DIR/include" \<br />LDFLAGS="-L$$GCC_DIR/lib -L$$DIR/arm-linux-uclibc/lib \<br />    -Wl,--dynamic-linker -Wl,$$DIR/i386-linux/lib/ld-uClibc.so.0" \<br />./configure
</pre>
            <p>See <a href="../../guide/goahead/source/building.html">Building GoAhead from Source</a> for full details
            on all the available <b>configure</b> switches.</p><a id="uclinux"></a> 
            <!--
            <h2 class="section">uClinux</h2>
            <p>TODO - these instructions are not accurate or current</p>
            <p>A patch for uClinux has been submitted and hopefully will soon be included in the default uClinux
            distributions from <a href="http://www.snapgear.org">SnapGear</a> and the <a href=
            "http://www.uclinux.org">uClinux project</a>. Until then, a <a href=
            "http://embedthis.com/downloads/Ejscript/patches.html" target="site">patch</a> is available to update
            uClinux with Ejscript support. We have used the SnapGear distribution and have followed the included
            instructions.</p>
            <p>Once you have uClinux installed, you should extract the Ejscript source code into the user/Ejscript
            directory. The following commands are a suggestion:</p>
            <pre>
cd UCLINUX_DIR/user<br />tar xvfz Ejscript-src-VERSION.tar.gz<br />mv Ejscript-VERSION Ejscript
</pre>
            <p>First you need to run the configuration utility. This can be either X based or curses based. To run the
            X utility:</p>
            <pre>
make xconfig
</pre>
            <p>After selecting your embedded board vendor, go into the Kernel/Library/Defaults Selection and Toggle
            Customize Vendor/User Settings to be <span style="font-weight: bold;">"y"</span>. After you then click Main
            Menu, then Save and Exit, a new dialog will be displayed with the Application Configuration options. Select
            Network Applications and you should see Ejscript configuration options toward the top of the screen. Select
            <span style="font-weight: bold;">"y"</span> for the Ejscript option and select "y" for any other Ejscript
            options you require. The Help button will explain each option.</p>
            <p>After configuring uClinux, you should type:</p>
            <pre>
make depend<br />make
</pre>
            <p>TODO - not correct: After the initial build, Ejscript remembers all the cross-compiler settings and you
            can recompile directly in the Ejscript directory. You can also customize your Ejscript configuration and
            then rebuild. For example: to enable the Embedded Gateway Interface:</p>
            <pre>
cd user/Ejscript<br />./configure<br />cd ../..<br />make user_only
</pre>
-->
        </div>
    </div>
<!-- BeginDsi "dsi/bottom.html" -->
	<div class="bottom">
		<p class="footnote"> 
            <a href="../../product/copyright.html" >&copy; Embedthis Software LLC, 2003-2014.
            All rights reserved. Embedthis and Embedthis GoAhead are trademarks of Embedthis Software LLC.</a>
		</p>
	</div>
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script type="text/javascript"> 
      google.load('search', '1', {language : 'en'});
      google.setOnLoadCallback(function() {
        var customSearchControl = new google.search.CustomSearchControl(
          '000262706376373952077:1hs0lhenihk');
        customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
        var options = new google.search.DrawOptions();
        options.enableSearchboxOnly("http://embedthis.com/search.html");
        customSearchControl.draw('cse-search-form', options);
      }, true);
    </script>
    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-179169-5']);
        _gaq.push(['_trackPageview']);
        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
</body>
</html>
